package org.gh.blackcloud.task;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class TaskCenter {

	private ExecutorService es;
	
	public TaskCenter() {
		this(0, 20);
	}
	
	public TaskCenter(int corePoolSize, int maximumPoolSize) {
		es = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>());
	}
	
	public void newOne(String url) {
		UploadTask task = new UploadTask();
		
	}
	
	public void shutdown() {
		es.shutdown();
	}
}
